package com.googlecode.gwtdb.client.work;

import com.googlecode.gwtdb.client.indexeddb.IDBFactory;


public class IndexedDB {
  
  public interface BrowserDBImpl{
    public IDBFactory getFactory();
  }
  
   public static class BrowserDBWebkitImpl implements BrowserDBImpl{

    @Override
    public native IDBFactory getFactory() /*-{
			return $wnd.indexedDB || $wnd.webkitIndexedDB
    }-*/;
     
   }
   
  // private static BrowserDBImpl browserDBImpl = GWT.create(BrowserDBImpl.class);
  
  /**
   * indexdb or null
   * 
   * @return
   */
  public static IDBFactory getIndexedDB() {
    return new BrowserDBWebkitImpl().getFactory();
    
  }
  
  
}
